﻿using Device;
using Prism.DryIoc;
using Prism.Ioc;
using Prism.Modularity;
using PrismWpf.Views;
using System.Configuration;
using System.Data;
using System.Windows;

namespace PrismWpf
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// 
    /// 4、继承 PrismApplication
    /// 
    /// </summary>
    public partial class App : PrismApplication
    {
        protected override Window CreateShell()
        {
/*
 *          5、返回主窗口 Window 对象
 */
            return Container.Resolve<MainView>();
        }

        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {
            containerRegistry.RegisterForNavigation<IndexView>("index");
            containerRegistry.RegisterForNavigation<OrderView>("order");
           // containerRegistry.RegisterForNavigation<DeviceView>("device");
        }

        protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)
        {
            base.ConfigureModuleCatalog(moduleCatalog);
            // 注册 DeviceModule 模块
            moduleCatalog.AddModule<DeviceModule>();
        }
    }

}
